package com.it.rabbitmqwithjiang.Listener;

import com.it.rabbitmqwithjiang.Dao.MessageDao;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DeadListener {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "Deletequeue", durable = "true"),
            exchange = @Exchange(name = "Deletedirect"),
            key = "Delete"
    ))
    public void listenDlQueue(MessageDao messageDao) {
        System.out.println("消费者接收到了Deletequeue 的延迟消息：{}"+messageDao.toString());

    }

}
